home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / diskutil / lockkey.lzh / BREAKDWN.TXT next >
Encoding:
Text File  |  1989-07-16  |  3.0 KB  |  55 lines

  1.  
  2.      Under GEMDOS, everything you see in a floppy's directory, and 
  3. a few other things, are gathered together into one single list of 
  4. names. Attached to each name in the list is an attribute byte that 
  5. identifies what the item is for. The average directory list will 
  6. contain folders, volume labels, hidden files, system files, read-
  7. only files, and, of course, normal files. Lock & Key works by 
  8. changing the attribute of a folder so that GEMDOS thinks the name 
  9. belongs to a hidden file, thus hiding the folder from view or use.
  10.  
  11.      When I first set out to write the key program, I thought it 
  12. would be a breeze. I had expected to be able to use the GEMDOS 
  13. function CHMOD, or Change Mode, to simply change the attribute of 
  14. the folder in question to 'hidden' status. But alas, any reference 
  15. to any folder with the CHMOD function generates an error. To get 
  16. around this problem, I found it was necessary to directly modify 
  17. the root directory of the disk. This required reading in several 
  18. sectors, finding the correct directory entry, changing the 
  19. attribute byte, (I'm not saying where that byte is, evil-doers) 
  20. and then writing the sectors back to the disk. Now add to that the 
  21. burden of performing complex pattern matching, unscrambling the 
  22. foldername and password, and working entirely in assembly. So much 
  23. for an easy program.
  24.  
  25.      Since I had never worked in assembly on the ST before, and 
  26. since I had no idea what the standard conventions and procedures 
  27. were for passing parameters among functions, I made it all up. 
  28. Some of you, upon examining the source code for the key, may find 
  29. my assembly language style atrocious, but try to remember my lack 
  30. of experience.
  31.  
  32.      The other program, the installer, was probably easier to 
  33. write than the key program, although it still took the longest to 
  34. finish. Since I needed to get some information from the user 
  35. requiring the keyboard, and since the file selector box was not 
  36. really practical, I decided it was time to write a self-contained 
  37. dialog box function, requiring no resource file, that would be 
  38. similar to the alert box yet allow input of a single line of text. 
  39. The function I eventually wrote, called simply dialog(), is 
  40. extremely useful anytime you want to get some kind of text from 
  41. the user. The function allows up to four lines of output text, one 
  42. line of input text and one or two buttons.  It also allows you to 
  43. use the default setting of your choice. The function will also 
  44. adjust itself for height and width, depending on how much text you 
  45. have to output.
  46.  
  47.      To make a key, the installer program will read in the file 
  48. LOCKKEY.DAT, which is actually a program file that has been 
  49. renamed. Next, the foldername and password are inserted in 
  50. scrambled form, and then the file is written to the disk as 
  51. KEY.TOS. If there is already a key present on the disk, you are 
  52. given a chance to cancel the installation process. The rest of the 
  53. program is general error checking and alert boxes.
  54.  
  55.